package com.shenfa.dao;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import com.ibatis.sqlmap.client.SqlMapClient;
import com.shenfa.bean.BackLetter;

/**
 * 
 * @author lidongsheng
 * 
 * @date 2011-8-19
 *
 */
public class LetterDao {
	@Autowired
	private SqlMapClient sqlMapClient;
	public void  addBackLetter(BackLetter letter) {
		try {
			sqlMapClient.insert("letter_manager.add", letter);
			
		} catch (SQLException e) {
			e.printStackTrace();
		}
	}
	
	public List<BackLetter> queryBackLetter(BackLetter letter){
		try {
			return sqlMapClient.queryForList("letter_manager.query", letter);
		} catch (SQLException e) {
			e.printStackTrace();
			return null;
		}
	}
	
}
